/**
 * Created by winny on 2016-11-3.
 */
(function (Framework7, $$, T7, myApp) {
    //由tplManager.js初始化  转到此
    //tplManager.init();
    var mainView = myApp.addView('#mainView', {
        dynamicNavbar: true,
        domCache: true
    });

    $$(document).on('pageBeforeInit', function (e) {
        var page = e.detail.page;
        pageBeforeInit(page);
    });
    $$(document).on('pageAfterAnimation', function (e) {
        var page = e.detail.page;
        pageAfterAnimation(page);
    });


    function getPhotopath() {
        xhr.getPhotopath({}, function (result, data) {
            //var data = {photo_Path:'http://h5.17wanxiao.com:8081/h5/getPhoto_Path.action'};
            if (data) {
                window.photo_Path = data.photo_Path;
            }
        });
    }
    function pageBeforeInit(page) {
        console.log(page)
        var name = page.name,
            query = page.query,
            from = page.from;
        switch (name) {
            case 'bound':
                // if (from === 'left') return;
                bound.initialize(query);
                break;
            case 'search':
                search.initialize(query);
                break;
            case 'model':
                model.initialize(query);
                break;
        }
    }
    function pageAfterAnimation(page) {
    }
    // tplManager.init();
})(Framework7, Dom7, Template7, myApp);